# 单双引号合用
print("输出一个中文：\'python\'")
print('-----------------------')

# 转义字符
print("1\t2")  # \t tab键
print("1\n2") # \n 换行
print('-----------------------')

# 字符串拼接（ +  麻烦） 
name = "张三"
age = 15
print("你好,",name)
print("你好," + name)
print("岁数:" + str(age) + "岁")
print('-----------------------')

# %占位形式    %s将变量变成字符串  %d将比那辆变成整型输出  %f float
print("你好,%s" %name)
print("你好,%s。年龄:%s" %(name,age))

score = 60.5
print("语文成绩是:%d分" %score)
print("变量score的数据类型是%s?" %(type(score)))
print('-----------------------')

# %还可进行小数点精度的控制
num = 19.99999
print("控制小数点精度为2位:%.2f" %num)
num1 = 15.55555
print("控制小数点精度为2位:%.2f" %num1)
num2 = 15.123456
print("控制小数点精度为2位:%.2f" %num2)
print('-----------------------')

# f-string
print(f"你好,{name}。年龄:{str(age) + "岁"},英语成绩:{num2:.2f}")

